package com.springframework.beans.factory.annotation;

import com.springframework.beans.factory.support.MyGenericBeanDefinition;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.core.type.MethodMetadata;
import org.springframework.lang.Nullable;

/**
 * @Author 虎哥
 * @Description 借助于 @Import 导入 Bean
 * 通过 @Import 导入的 Configuration Class 会解析成该对象,不过 factoryMethodMetadata 还是为 null
 * <p>
 * 要带着问题去学习,多猜想多验证
 **/
public class MyAnnotatedGenericBeanDefinition extends MyGenericBeanDefinition implements MyAnnotatedBeanDefinition {

    private final AnnotationMetadata metadata;

    @Nullable
    private MethodMetadata factoryMethodMetadata;


    public MyAnnotatedGenericBeanDefinition(Class<?> beanClass) {
        setBeanClass(beanClass);
        this.metadata = AnnotationMetadata.introspect(beanClass);
    }

    @Override
    public AnnotationMetadata getMetadata() {
        return null;
    }

    @Override
    public MethodMetadata getFactoryMethodMetadata() {
        return null;
    }

    @Override
    public int getRole() {
        return 0;
    }

    @Override
    public boolean isPrimary() {
        return false;
    }

    @Override
    public boolean isAutowireCandidate() {
        return false;
    }
}
